<?php

include_once('logic/action/Action.php');
include_once('logic/view/listcomments_view.php');

class ListCommentsAction extends Action
{
	public function perform()
	{
		$photos = new PhotosDAO();
		$comments = new CommentsDAO();
		$view = new ListCommentsView();

		$name = HttpRequest::getRequest("name");
		$id = HttpRequest::getRequest("id");
		$view->setParam('_id', $id);

		$comments = $comments->getAllComments($name);
		foreach ($comments as $comment)
		{
				$view->addComment($comment[0],$comment[1],$comment[2]);
		}
		$view->display();

	}
}

?>
